

<template>
  <view>
    <view class="mt-4" v-for="(group, i) in groupList" :key="i">
      <view class="pa-3 fz-14 op-6" v-if="group.title">{{ group.title }}</view>
      <q-list :list="group.list" arrow @item="onItem"></q-list>
    </view>
  </view>
</template>

<script>
import { mapState } from "vuex";

export default {
  computed: {
    ...mapState({
      inSdk: (s) => s.sysInfo.inSdk,
    }),
    groupList() {
      let groups = [
        {
          list: [
            {
              title: "设置",
              icon: "/static/icon/e-setting.svg",
              link: "mine/settings",
            },
          ],
        },
      ];
      if (!this.inSdk) {
        groups.push({
          list: [
            {
              title: "联系客服",
              icon: "/static/icon/e-contact.svg",
              openType: "contact",
            },
          ],
        });
      }
      return groups;
    },
  },
  data() {
    return {};
  },
  methods: {
    onItem(it) {
      if (it.openType) return;
      if (it.link) {
        this.$navTo(it.link, { title: it.title });
      }
    },
  },
};
</script>